package top.hundreds.oasys.bean.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public enum MeetingType {

    PROJECT(0,"项目会议"),
    REGULAR(1,"日常例会"),
    TRAINING(2,"培训会议"),
    MOUTH(3,"月度汇报会议"),
    QUARTER(4,"季度汇报会议"),
    YEAR(5,"年度汇报会议");

    @JsonValue
    @EnumValue
    private final Integer value;

    private final String label;

    public static MeetingType formValue(Object o) {
        if (o != null) {
            for (MeetingType meetingType : values()) {
                if (meetingType.getValue().equals(o)) {
                    return meetingType;
                }
            }
        }
        return null;
    }

    public static MeetingType formLabel(Object o) {
        if (o != null) {
            for (MeetingType meetingType : values()) {
                if(meetingType.getLabel().equals(o)){
                    return meetingType;
                }
            }
        }
        return null;
    }
}
